<?php //debug($planos);?>
<?php echo $this->Form->create('planos', array('action' => 'planos')); ?>
<div class="widget">
    <div class="whead"><h6>LISTADO DE CONTRATOS</h6><div class="clear"></div></div>
    <div class="shownpars">
        <table cellpadding="0" cellspacing="0" border="0" class="dTable">
            <thead>
                <tr>
                    <th>Nro</th>
                    <th>Codigo</th>
                    <th>Descripcion</th>                                                        
                    <th>Proveedor</th>
                    <th>Field Work Order ($us.)</th>
                    <th>Change Work Order ($us.)</th>
                    <th>Contrato ($us.)</th>
                    <th>Accion</th>
                </tr>
            </thead>
            <tbody>
                <?php $i = 1; ?>
                <?php foreach ($contratos as $cont): ?>  
                <?php $idContrato = $cont['Contrato']['id']; ?>              
                <tr class="gradeX">
                <td><?php echo $i; $i++; ?></td>
                <td><?php echo $cont['Contrato']['codigo'];?></td> 
                <td><?php echo $cont['Contrato']['descripcion'];?></td>
                <td><?php echo $cont['Contrato']['proveedor'];?></td>
                
                <td><?php 
                //echo $cont['Contrato']['monto1'];
                //echo $o['Ordene']['monto']; 
                $montoP = $cont['Contrato']['monto1'];
                    $modMontoPrin = $this->Number->format($montoP, array(
                        'places' => 2,
                        'before' => ' ',
                        'escape' => false,
                        'decimals' => '.',
                        'thousands' => ','
                            ));
                    echo $modMontoPrin;
                ?></td>
                <td><?php //echo $cont['Contrato']['monto2'];
                $montoP = $cont['Contrato']['monto2'];
                    $modMontoPrin = $this->Number->format($montoP, array(
                        'places' => 2,
                        'before' => ' ',
                        'escape' => false,
                        'decimals' => '.',
                        'thousands' => ','
                            ));
                    echo $modMontoPrin;
                ?></td>
                <td><?php //echo $cont['Contrato']['monto3'];
                $montoP = $cont['Contrato']['monto3'];
                    $modMontoPrin = $this->Number->format($montoP, array(
                        'places' => 2,
                        'before' => ' ',
                        'escape' => false,
                        'decimals' => '.',
                        'thousands' => ','
                            ));
                    echo $modMontoPrin;
                ?></td>

                <td>
                    <?php echo $this->Html->link('DETALLE',array('controller'=>'Publicos', 'action'=>'detallecontrato', $idContrato));?> 
                    
                </tr>
                <?php endforeach; ?>                
            </tbody>
        </table>
    </div> 
</div> 